
narrowCastRegister();

// The speed of one transition (fadeIn or fadeOut).
// Full execution time will be:
// (browser navigation time) + speed * 2;
// You can set this to slow, medium, fast, or number of ms.
var speed = 'slow';

$('html, body').hide();
$(document).ready(function() {
    $('html, body').fadeIn(speed, function() {
        $('a[href], button[href]').click(function(event) {
            var url = $(this).attr('href');
            if (url.indexOf('#') == 0 || url.indexOf('javascript:') == 0) return;
            event.preventDefault();
            $('html, body').fadeOut(speed, function() {
                window.location = url;
            });
        });
    });
});

function hidePage() {
	$('html, body').hide();
}

function showPage() {
	$('html, body').fadeIn(speed, function() {});
}

function narrowCastRegister() {
	if (window.top.frames && window.top.frames[0] && window.top.frames[0].hello) {
		window.top.frames[0].hello(document.location.href);
	}
}

function showtime() {
	now = new Date();
	mm = now.getMinutes();
	if (mm<10) mm = "0" + mm;
	ss = now.getSeconds();
	if (ss<10) ss = "0" + ss;
	tijd = now.getHours() + ":" + mm + ":" + ss;
	document.all.clock.innerHTML = tijd;
	setTimeout('showtime();', 1000);
}

var counter;
var pls;
var t;
function resetCounter(sec) {
	counter = sec;
}

function pulse(sec) {
	counter--;
	var blok = "";
	for (t=0; t<counter; t++) blok = blok + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
	$("#counter").html(blok);
	pls = setTimeout("pulse();", 1000);
}

function startPulse() {
	pls = setTimeout("pulse();", 1000);
}